//
//  ZYCCustomTipView.m
//  ZDSC
//
//  Created by ZDTX on 2021/8/13.
//

#import "ZYCCustomTipView.h"
@interface ZYCCustomTipView  ()
@property (nonatomic, strong) UIImageView *iconView;
@property (nonatomic, strong) UILabel *titleLabel;
@end
@implementation ZYCCustomTipView

- (void)setDict:(NSDictionary *)dict{
    _dict = dict;
    _iconView.image = [UIImage imageNamed:dict[@"imageName"]];
    _titleLabel.text = dict[@"title"];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.iconView];
        [self addSubview:self.titleLabel];

        [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(49.0f, 49.0f));
            make.top.centerX.equalTo(self);
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.mas_equalTo(83.0f);
            make.top.equalTo(self.iconView.mas_bottom).offset(10.0f);
        }];

    }
    return self;
}


- (UIImageView *)iconView {
    if (!_iconView) {
        _iconView = [[UIImageView alloc] init];
    }
    return _iconView;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithFont:kCustomFont(@"PingFangSC-Regular", 14.0f) titleColor:HEX_RGB(@"333333") textAlignment:ZZTextAlignmentCenter];
        _titleLabel.numberOfLines = 0;
    }
    return _titleLabel;
}

@end
